"""CreateServicesTable Migration."""

from masoniteorm.migrations import Migration


class CreateServicesTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with create("services") as table:
            table.increments("id")
            table.integer('cid').unsigned()
            table.foreign("cid").references('id').on('category').comment('分类Id')
            table.string("name_zh")
            table.string("name_ug")
            table.enum('type',['number','square']).comment('number=次数｜｜square=平方')
            table.text("images")
            table.text("description")
            table.double("vip_benefit")
            table.tiny_integer('is_delete').default(0)
            table.timestamps()

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("services")
